package com.itmd.aop;

import org.aspectj.lang.ProceedingJoinPoint;

public class MyAspect {

    public void before () {
        System.out.println("前置增强");
    }

    public void after() {
        System.out.println("最终后置增强");
    }

    public void afterReturning () {
        System.out.println("后置增强");
    }


    //环绕指的就是 即有前置增强，又有后置增强
    public Object around(ProceedingJoinPoint pjp) throws Throwable {
        System.out.println("环绕前置增强");
        Object o = pjp.proceed();
        System.out.println("环绕后增强");
        return o;
    }

    public void afterThrowing() {
        System.out.println("异常抛出增强");
    }

}
